<?php

/**
 * LotFacturation filter form base class.
 *
 * @package    kc_report_proto
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BaseLotFacturationFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'lot_id'                     => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'lof_libelle'                => new sfWidgetFormFilterInput(),
      'lof_montant_ht'             => new sfWidgetFormFilterInput(),
      'lof_charge_jh'              => new sfWidgetFormFilterInput(),
      'lof_date_prev_pv_reception' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'lof_date_reel_pv_reception' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate())),
      'lof_commentaire'            => new sfWidgetFormFilterInput(),
      'lof_est_facture'            => new sfWidgetFormFilterInput(),
    ));

    $this->setValidators(array(
      'lot_id'                     => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'lof_libelle'                => new sfValidatorPass(array('required' => false)),
      'lof_montant_ht'             => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'lof_charge_jh'              => new sfValidatorSchemaFilter('text', new sfValidatorNumber(array('required' => false))),
      'lof_date_prev_pv_reception' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'lof_date_reel_pv_reception' => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'lof_commentaire'            => new sfValidatorPass(array('required' => false)),
      'lof_est_facture'            => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
    ));

    $this->widgetSchema->setNameFormat('lot_facturation_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'LotFacturation';
  }

  public function getFields()
  {
    return array(
      'lof_id'                     => 'Number',
      'lot_id'                     => 'Number',
      'lof_libelle'                => 'Text',
      'lof_montant_ht'             => 'Number',
      'lof_charge_jh'              => 'Number',
      'lof_date_prev_pv_reception' => 'Date',
      'lof_date_reel_pv_reception' => 'Date',
      'lof_commentaire'            => 'Text',
      'lof_est_facture'            => 'Number',
    );
  }
}
